package com.gitee.wsl.ext.number

//阶乘
fun Int.factorial(): Int {
    return if (this <= 0) {
        1
    } else {
        this * (this - 1).factorial()
    }
}